home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
dax1.exe
/
DAP
/
DAPE
/
DAPSWIT.C
< prev
next >
Wrap
Text File
|
1992-07-15
|
4KB
|
76 lines
// ╔════════════════════════════════════════════════════════════════════╗
// ║ ║
// ║ module: dapswit.c ║
// ║ abstract: This module contains the API that demultiplexes all ║
// ║ incoming requests, and calls the appropriate API to ║
// ║ service the request. ║
// ║ ║
// ║ environment: NetWare 3.x v3.11 ║
// ║ Network C for NLMs SDK ║
// ║ CLib v3.11 ║
// ║ ║
// ║ This software is provided as is and carries no warranty ║
// ║ whatsoever. Novell disclaims and excludes any and all implied ║
// ║ warranties of merchantability, title and fitness for a particular ║
// ║ purpose. Novell does not warrant that the software will satisfy ║
// ║ your requirements or that the software is without defect or error ║
// ║ or that operation of the software will be uninterrupted. You are ║
// ║ using the software at your risk. The software is not a product ║
// ║ of Novell, Inc. or any of subsidiaries. ║
// ║ ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ maintenance history: ║
// ║ level date pi description ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ 001 03/03/92 kl initial release. ║
// ╚════════════════════════════════════════════════════════════════════╝
#include "dap/dapsys.h"
//
// This routine is called when a new DAP is received. It determines
// the DAP type, and calls the corresponding DAP API. It executes
// using the caller's thread of execution, in this case the Service
// RequestQueue thread.
//
void DAPInvalidRequest(DAPDATA *DAPid)
{
DAPprintf("Invalid request code %d from (%x)",
DAPid->dapRequest.requestCode,
DAPid->dapRequest.sessionID);
//
// Set the DAP return code
//
DAPid->dapReply.returnCode = DAP_INVALID_REQUEST;
//
// Now send the result to the client
//
DAPEnqueueServiceReply(DAPid);
}
//
// The following API is modified to support new DAP's.
//
// It is called from the service request queue thread to execute
// the appropriate DAP request.
//
void DAPDispatchRequestAPI(DAPDATA *DAPid)
{
DAPStateON(DAPid,DAP_SERVICE);
switch( DAPid->dapRequest.requestCode ){
case DAPALLOCATESESSION: DAPAllocateSession(DAPid); break;
case DAPDEALLOCATESESSION: DAPDeAllocateSession(DAPid); break;
case DAPADDOPERANDS: DAPAddOperands(DAPid); break;
case DAPSUBTRACTOPERANDS: DAPSubtractOperands(DAPid); break;
case DAPMULTIPLYOPERANDS: DAPMultiplyOperands(DAPid); break;
case DAPDIVIDEOPERANDS: DAPDivideOperands(DAPid); break;
case DAPRESETCALCULATOR: DAPResetCalculator(DAPid); break;
case DAPSTOREVALUE: DAPStoreValue(DAPid); break;
case DAPRECALLVALUE: DAPRecallValue(DAPid); break;
default: DAPInvalidRequest(DAPid); break;
}
DAPStateOFF(DAPid,DAP_SERVICE);
}